/*
*
* LeadsMapper.java
* @date 2019-02-14
*/
package com.lyz.myself.mapper;

import com.lyz.myself.pojo.Po.Leads;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface LeadsMapper {

    /**
     * 根据id删除线索(可批量删除）
     * @param delete_role_id
     * @param company_id
     * @param delete_time
     * @param list
     * @return
     */
    int deleteLeads(@Param("delete_role_id") Integer delete_role_id, @Param("company_id") Integer company_id, @Param("delete_time") Integer delete_time,@Param("list") List<Integer> list);
    /**
     *
     * @mbg.generated 2019-02-14
     */
    int deleteByPrimaryKey(Integer leads_id);

    /**
     *
     * @mbg.generated 2019-02-14
     */
    int insert(Leads record);

    /**
     *添加线索
     * @mbg.generated 2019-02-14
     */
    int insertSelective(Leads record);



    /**
     *根据id查看线索信息
     * @mbg.generated 2019-02-14
     */
    List<Map<String, String>> selectByPrimaryKey(@Param("leads_id")Integer leads_id,@Param("company_id")Integer company_id);

    /**
     *修改线索
     * @mbg.generated 2019-02-14
     */
    int updateByPrimaryKeySelective(Leads record);

    /**
     * 我的线索
     * @param
     * @param map
     * @return
     */
    List<Map<String,Object>> selectAllLeads(Map<String,Object> map);


    /**
     * 线索池（可查看本公司下所有的线索）
     * @param
     * @param map
     * @return
     */
    List<Map<String,Object>> selectAllPool(Map<String,Object> map);

    /**
     * 领取线索
     * @param list
     * @param have_time
     * @return
     */
    int getToReceive(@Param("list") List<Integer> list,@Param("have_time")Integer have_time,@Param("owner_role_id")Integer owner_role_id);

    /**
     * 放入线索池
     * @param list
     * @return
     */
    int putCuePool(@Param("list") List<Integer> list);
    /**
     *
     * @mbg.generated 2019-02-14
     */
    int updateByPrimaryKey(Leads record);
}